package com.fieldchain.ex.fa100.ui.personal.activity;

import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.fieldchain.ex.fa100.R;
import com.fieldchain.ex.fa100.base.MyBaseActivity;
import com.fieldchain.ex.fa100.ui.personal.adapter.BonusAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

/**
 * Created by biyunlong
 * Email: 1225198434@qq.com
 * Data:  2018/9/16
 */
public class BonusActivity extends MyBaseActivity implements View.OnClickListener {
    private RelativeLayout reaBack;
    private TextView tvCenter;
    private TextView tvRight;
    private SmartRefreshLayout refresh;
    private RecyclerView rv;
    private RelativeLayout reaEmpty;
    private TextView tvEmpty;

    private BonusAdapter adapter;

    @Override
    public void findView() {
        reaBack = findViewById(R.id.rea_back);
        tvCenter = findViewById(R.id.tv_center);
        tvRight = findViewById(R.id.tv_right);
        refresh = findViewById(R.id.refresh);
        rv = findViewById(R.id.rv);
        reaEmpty = findViewById(R.id.rea_empty);
        tvEmpty = findViewById(R.id.tv_empty);
    }

    @Override
    public void setValue() {
        reaBack.setOnClickListener(this);
        tvRight.setOnClickListener(this);
        tvCenter.setText("交易分红");
        tvEmpty.setText("暂无分红记录");

        rv.setLayoutManager(new LinearLayoutManager(mContext));
        adapter = new BonusAdapter(mContext);
        rv.setAdapter(adapter);
    }

    @Override
    public int getLayout() {
        return R.layout.activity_bonuslist;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rea_back:
                finish();
                break;
            case R.id.tv_right:
                mContext.startActivity(new Intent(mContext, GuizeActivity2.class));
                break;
        }
    }
}
